﻿using System;
using System.Collections.Generic;
using System.Text;

namespace VH6I_B4.Datawarehouse.Models
{
    /// <summary>
    /// Deze klasse omschrijft een verzameling feiten (volume, promotion, units, etc)
    /// Een instantie van deze klasse komt dus overeen met een rij in de feiten tabel.
    /// </summary>
    class SalesFactRecord
    {
        private Product product;
        private Supermarket supermarket;
        private Timeperiod timeperiod;
        private Dictionary<FactType, double> facts;

        public SalesFactRecord(Product product,
            Supermarket supermarket,
            Timeperiod timeperiod)
        {
            Product = product;
            Supermarket = supermarket;
            Timeperiod = timeperiod;
            facts = new Dictionary<FactType, double>();
        }

        public void SetFact(FactType factType, double factValue)
        {
            facts[factType] = factValue;
        }

        public double GetFact(FactType factType)
        {
            double result = 0;
            if (facts.ContainsKey(factType))
                result = facts[factType];
            return result;
        }

        #region Simpele getters en setters
        public Product Product { get { return product; } set { product = value; } }
        public Supermarket Supermarket { get { return supermarket; } set { supermarket = value; } }
        public Timeperiod Timeperiod { get { return timeperiod; } set { timeperiod = value; } }
        #endregion
    }
}
